package cn.edu.imau.zy.system.service.impl;

import cn.edu.imau.zy.common.core.text.Convert;
import cn.edu.imau.zy.common.core.entity.system.SpecialityBase;
import cn.edu.imau.zy.system.mapper.SpecialityBaseMapper;
import cn.edu.imau.zy.system.service.ISpecialityBaseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 专业Service业务层处理
 *
 * @author wyz
 * @date 2020-06-18
 */
@Service
public class SpecialityBaseServiceImpl extends ServiceImpl<SpecialityBaseMapper, SpecialityBase> implements ISpecialityBaseService {

    @Autowired
    private SpecialityBaseMapper specialityBaseMapper;

    /**
     * 查询专业
     *
     * @param specialityCode 专业ID
     * @return 专业
     */
    @Override
    public SpecialityBase selectSpecialityBaseById(String specialityCode) {
        return specialityBaseMapper.selectSpecialityBaseById(specialityCode);
    }

    /**
     * 查询专业列表
     *
     * @param specialityBase 专业
     * @return 专业
     */
    @Override
    public List<SpecialityBase> selectSpecialityBaseList(SpecialityBase specialityBase) {
        return specialityBaseMapper.selectSpecialityBaseList(specialityBase);
    }

    /**
     * 新增专业
     *
     * @param specialityBase 专业
     * @return 结果
     */
    @Override
    public int insertSpecialityBase(SpecialityBase specialityBase) {
        return specialityBaseMapper.insertSpecialityBase(specialityBase);
    }

    /**
     * 修改专业
     *
     * @param specialityBase 专业
     * @return 结果
     */
    @Override
    public int updateSpecialityBase(SpecialityBase specialityBase) {
        return specialityBaseMapper.updateSpecialityBase(specialityBase);
    }

    /**
     * 删除专业对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSpecialityBaseByIds(String ids) {
        return specialityBaseMapper.deleteSpecialityBaseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专业信息
     *
     * @param specialityCode 专业ID
     * @return 结果
     */
    public int deleteSpecialityBaseById(String specialityCode) {
        return specialityBaseMapper.deleteSpecialityBaseById(specialityCode);
    }
}
